import scrapy
import urllib.request

from scrapy_douyin_48.items import ScrapyDouyin48Item


class MoveSpider(scrapy.Spider):
    name = "move"
    allowed_domains = ["www.douyin.com"]
    start_urls = ["https://www.douyin.com/video/7481633911471148326"]

    def parse(self, response):
        moive = response.xpath('//div[@id="root"]//video/source[3]/@src').get()
        print("===================================")
        print(moive)

        item = ScrapyDouyin48Item(moive=moive)

        yield item
